package dxn.nl.export.deal.export;

import dxn.nl.file.biz.po.FileExportApplyDetail;
import dxn.nl.file.biz.service.ExportFileBaseService;
import dxn.nl.file.client.model.dto.CsExportExcelSheetHeadDto;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

public class ExportDealSteamQueryBiz extends ExportDealBaseBiz
{
    private static final Logger log = LoggerFactory.getLogger(ExportDealSteamQueryBiz.class);

    private final CompletableFuture<Boolean> completableFuture = new CompletableFuture<>();

    public ExportDealSteamQueryBiz(HashMap<String, CsExportExcelSheetHeadDto> sheetHeadMap, ExportFileBaseService exportFileBaseService, FileExportApplyDetail fileExportApplyDetail)
    {
        super(sheetHeadMap,exportFileBaseService, fileExportApplyDetail);
    }

    public void finish(String message)
    {
        updateFinishStatus(message);
        completableFuture.complete(true);
    }

    public void waitComplete() throws ExecutionException, InterruptedException {
        completableFuture.get();
    }
}
